import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

Future showAnimDialog(BuildContext context, Dialog dialog, {bool? barrierDismissible}) async {
  await showGeneralDialog(
      context: context,
      barrierColor: Colors.black.withOpacity(0.4),
      barrierDismissible: barrierDismissible ?? false,
      barrierLabel: "",
      transitionDuration: const Duration(milliseconds: 200),
      transitionBuilder: (BuildContext context, Animation<double> anim1, Animation<double> anim2, child) {
        return Transform.scale(
          scale: anim1.value,
          child: Opacity(
            opacity: anim1.value,
            child: child,
          ),
        );
      },
      pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
        return dialog;
      }
  );
}